//
//  JGKeyboardEvent.h
//  JGGameController
//
//  Created by jagger.tu on 2024/12/25.
//

#import <Foundation/Foundation.h>
#import <JGVividEngine/JGControlEvent.h>
#import <JGVividEngine/JGVividEngineDataDefine.h>
#import <JGVividEngine/JGWinKeyboardDefault.h>


typedef NS_OPTIONS(NSUInteger, JGKeyboardModifierButton) {
    JGKeyboardModifierButtonNone       = 0,
    /// Shift 键
    JGKeyboardModifierButtonShift      = 1 << 0,
    /// Control 键
    JGKeyboardModifierButtonCtrl       = 1 << 1,
    /// Alt 键
    JGKeyboardModifierButtonAlt        = 1 << 2,
    /// NumLock 开启状态
    JGKeyboardModifierButtonNumLockOn  = 1 << 3,
    /// CapsLock 开启状态
    JGKeyboardModifierButtonCapsLockOn = 1 << 4
};

NS_ASSUME_NONNULL_BEGIN

/// 游戏键盘事件
@interface JGKeyboardEvent : JGControlEvent

/// 键盘值
@property (nonatomic, assign) NSInteger code;

/// 键盘状态
@property (nonatomic, assign) BOOL pressed;

/// 键盘类型
@property (nonatomic, assign) JGKeyboardType type;

/// 修饰键类型 -- 一般无需调用
@property (nonatomic, assign) JGKeyboardModifierButton modifier;

- (instancetype)initWithWinCode:(NSInteger)code isPressed:(BOOL)isPressed;
- (instancetype)initWithWinCode:(NSInteger)code isPressed:(BOOL)isPressed modifier:(JGKeyboardModifierButton)modifier;
- (instancetype)initWithAndroidCode:(NSInteger)code isPressed:(BOOL)isPressed;


@end

NS_ASSUME_NONNULL_END
